﻿using KFC.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace KFC.MonAnF
{
    public abstract class MonAn
    {

        protected string _maMonAn;

        public string MaMonAn
        {
            get { return _maMonAn; }
            set { _maMonAn = value; }
        }

        protected string _tenMonAn;

        public string TenMonAn
        {
            get { return _tenMonAn; }
            set { _tenMonAn = value; }
        }

        protected int _donGia;

        public int DonGia
        {
            get { return _donGia; }
            set { _donGia = value; }
        }

        protected string _chiTietMonAn;

        public string ChiTietMonAn
        {
            get { return _chiTietMonAn; }
            set { _chiTietMonAn = value; }
        }

        protected int _soLuong;

        public int SoLuong
        {
            get { return _soLuong; }
            set { _soLuong = value; }
        }

        protected string _loaiDoiTuong;

        public string LoaiDoiTuong
        {
            get { return _loaiDoiTuong; }
            set { _loaiDoiTuong = value; }
        }

        public virtual XmlDocument GetExtraAttributes()
        {
            return UtilsXML.PortExAttToXML();
        }

        public SafeMonAn GetSafeInfo()
        {
            SafeMonAn kq = new SafeMonAn();
            
            kq.Attach(this);
            return kq;
        }

        public virtual void SetInforFrom(ServiceReferenceKFC.SafeMonAnDTO i)
        {
            ChiTietMonAn = i.ChiTietMonAn;
            DonGia = i.DonGia;
            LoaiDoiTuong = i.LoaiDoiTuong;
            MaMonAn = i.MaMonAn;
            SoLuong = i.SoLuong;
            TenMonAn = i.TenMonAn;
        }

        public virtual List<string> GetAllAttributes()
        {
            List<string> kq = new List<string>();
            kq.Add("Mã món ăn");
            kq.Add("Tên món ăn");
            kq.Add("Đơn giá");
            kq.Add("Chi tiết");
            kq.Add("Số lượng");
            return kq;
        }

        public virtual string LayTenLoaiDoiTuong()
        {
            return null;
        }

        public virtual MonAn Clone()
        {
            return null;
        }

        public virtual void ThayDoiGiaDongBo(int soTienChenhLech)
        {
        }

        public virtual void ThayDoiGiaDongBoTheoMonDon(int soTienChenhLech, string sender)
        {
        }

        public virtual void CreateMonAn()
        {
             //phat sinh giao dien nhap lieu dong
        }
    }
}
